package cn.brilliantfuture.commentry.entity;

// Generated 2012-5-29 10:32:36 by Hibernate Tools 3.3.0.GA

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * ExpenseRecord generated by hbm2java
 */
@Entity
@Table(name = "expense_record", catalog = "cabinet", uniqueConstraints = @UniqueConstraint(columnNames = "expense_code"))
public class ExpenseRecord implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer expenseRecordId;
	private String expenseCode;
	private int purchaserId;
	private int groupId;
	private String orderCode; 
	private int type = 1; //1为支付成功；2为退款成功
	private double amount = 0.0D;
	private double expenseBeforeBalance = 0.0D;
	private double expenseAfterBalance = 0.0D;
	private String unit = "CNY";
	private Date expenseTime;
	private double refundBeforeBalance = 0.0D;
	private double refundAfterBalance = 0.0D;
	private Date refundTime;
	private String expenseNote;
	private String refundNote;

	public ExpenseRecord() {
	}

	public ExpenseRecord(String expenseCode, int purchaserId, int groupId, String orderCode, int type, double amount, double expenseBeforeBalance, double expenseAfterBalance, String unit, Date expenseTime, double refundBeforeBalance, double refundAfterBalance) {
		this.expenseCode = expenseCode;
		this.purchaserId = purchaserId;
		this.groupId = groupId;
		this.orderCode = orderCode;
		this.type = type;
		this.amount = amount;
		this.expenseBeforeBalance = expenseBeforeBalance;
		this.expenseAfterBalance = expenseAfterBalance;
		this.unit = unit;
		this.expenseTime = expenseTime;
		this.refundBeforeBalance = refundBeforeBalance;
		this.refundAfterBalance = refundAfterBalance;
	}

	public ExpenseRecord(String expenseCode, int purchaserId, int groupId, String orderCode, int type, double amount, double expenseBeforeBalance, double expenseAfterBalance, String unit, Date expenseTime, double refundBeforeBalance, double refundAfterBalance, Date refundTime, String expenseNote, String refundNote) {
		this.expenseCode = expenseCode;
		this.purchaserId = purchaserId;
		this.groupId = groupId;
		this.orderCode = orderCode;
		this.type = type;
		this.amount = amount;
		this.expenseBeforeBalance = expenseBeforeBalance;
		this.expenseAfterBalance = expenseAfterBalance;
		this.unit = unit;
		this.expenseTime = expenseTime;
		this.refundBeforeBalance = refundBeforeBalance;
		this.refundAfterBalance = refundAfterBalance;
		this.refundTime = refundTime;
		this.expenseNote = expenseNote;
		this.refundNote = refundNote;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "expense_record_id", unique = true, nullable = false)
	public Integer getExpenseRecordId() {
		return this.expenseRecordId;
	}

	public void setExpenseRecordId(Integer expenseRecordId) {
		this.expenseRecordId = expenseRecordId;
	}

	@Column(name = "expense_code", unique = true, nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getExpenseCode() {
		return this.expenseCode;
	}

	public void setExpenseCode(String expenseCode) {
		this.expenseCode = expenseCode;
	}

	@Column(name = "purchaser_id", nullable = false)
	public int getPurchaserId() {
		return this.purchaserId;
	}

	public void setPurchaserId(int purchaserId) {
		this.purchaserId = purchaserId;
	}

	@Column(name = "group_id", nullable = false)
	public int getGroupId() {
		return this.groupId;
	}

	public void setGroupId(int groupId) {
		this.groupId = groupId;
	}

	@Column(name = "order_code", nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getOrderCode() {
		return this.orderCode;
	}

	public void setOrderCode(String orderCode) {
		this.orderCode = orderCode;
	}

	@Column(name = "type", nullable = false)
	public int getType() {
		return this.type;
	}

	public void setType(int type) {
		this.type = type;
	}

	@Column(name = "amount", nullable = false, precision = 22, scale = 0)
	public double getAmount() {
		return this.amount;
	}

	public void setAmount(double amount) {
		this.amount = amount;
	}

	@Column(name = "expense_before_balance", nullable = false, precision = 22, scale = 0)
	public double getExpenseBeforeBalance() {
		return this.expenseBeforeBalance;
	}

	public void setExpenseBeforeBalance(double expenseBeforeBalance) {
		this.expenseBeforeBalance = expenseBeforeBalance;
	}

	@Column(name = "expense_after_balance", nullable = false, precision = 22, scale = 0)
	public double getExpenseAfterBalance() {
		return this.expenseAfterBalance;
	}

	public void setExpenseAfterBalance(double expenseAfterBalance) {
		this.expenseAfterBalance = expenseAfterBalance;
	}

	@Column(name = "unit", nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getUnit() {
		return this.unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "expense_time", nullable = false, length = 19)
	@NotNull
	public Date getExpenseTime() {
		return this.expenseTime;
	}

	public void setExpenseTime(Date expenseTime) {
		this.expenseTime = expenseTime;
	}

	@Column(name = "refund_before_balance", nullable = false, precision = 22, scale = 0)
	public double getRefundBeforeBalance() {
		return this.refundBeforeBalance;
	}

	public void setRefundBeforeBalance(double refundBeforeBalance) {
		this.refundBeforeBalance = refundBeforeBalance;
	}

	@Column(name = "refund_after_balance", nullable = false, precision = 22, scale = 0)
	public double getRefundAfterBalance() {
		return this.refundAfterBalance;
	}

	public void setRefundAfterBalance(double refundAfterBalance) {
		this.refundAfterBalance = refundAfterBalance;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "refund_time", length = 19)
	public Date getRefundTime() {
		return this.refundTime;
	}

	public void setRefundTime(Date refundTime) {
		this.refundTime = refundTime;
	}

	@Column(name = "expense_note", length = 1024)
	@Length(max = 1024)
	public String getExpenseNote() {
		return this.expenseNote;
	}

	public void setExpenseNote(String expenseNote) {
		this.expenseNote = expenseNote;
	}

	@Column(name = "refund_note", length = 1024)
	@Length(max = 1024)
	public String getRefundNote() {
		return this.refundNote;
	}

	public void setRefundNote(String refundNote) {
		this.refundNote = refundNote;
	}

}
